# == Schema Information
# Schema version: 22
#
# Table name: memberships
#
#  id            :integer       not null, primary key
#  user_id       :integer       not null
#  discipline_id :integer       not null
#  created_at    :datetime      not null
#

class Membership < ActiveRecord::Base
  belongs_to :user
  belongs_to :discipline, :counter_cache => true
  validates_presence_of :user, :discipline
  validates_uniqueness_of :user_id, :scope => [:discipline_id]
end
